Skip to content

Nightly2main 2025/10/10#127

Closed
JacksonTheMaster wants to merge 30 commits into
mainfrom
nightly
Closed

Nightly2main 2025/10/10#127
JacksonTheMaster wants to merge 30 commits into
mainfrom
nightly

Conversation

@JacksonTheMaster

Copy link
Copy Markdown
Member

No description provided.

mitoskalandiel and others added 26 commits September 29, 2025 16:29
….go so we don't slip on those zips

apparently zips are a slippery slope, ok I'll stop now 🤣
fix: ensure run_bepinex.sh is removed only on Linux if it exists
This is attempt 2 to fix path traversal issues within steamcmd-helper…

working still as expected
…individually getting the state, reducing load on the backend.
Co-authored-by: JLangisch <jakob.langisch@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nd adjust JWT generation accordingly. Defaults to 1 month if user sends a GET instead.
The race condition between writing to the Http2 Response Writer occurs
when SSE connection is closed, but the Fprintf formatting code is still
executing.
```
panic: Write called after Handler finished

goroutine 9953 [running]:
net/http.(*http2responseWriter).write(0x2?, 0xc0000944e0?, {0xc000096500?, 0x7ff6153450be?, 0x7ff615d95060?}, {0x0?, 0xc000500808?})
        /usr/local/go/src/net/http/h2_bundle.go:6987 +0x13f
net/http.(*http2responseWriter).Write(0xc0000944e0?, {0xc000096500?, 0xa?, 0xc000391f50?})
        /usr/local/go/src/net/http/h2_bundle.go:6976 +0x2a
fmt.Fprintf({0x2426bb5a1a0, 0xc0001982d0}, {0x7ff61584992c, 0xa}, {0xc000391f50, 0x1, 0x1})
        /usr/local/go/src/fmt/print.go:225 +0x97
github.com/JacksonTheMaster/StationeersServerUI/v5/src/core/ssestream.(*SSEManager).streamMessages(0x0?, {0x7ff6159deac0, 0xc0001982d0}, {0x2426b765b58, 0xc0001982d0}, 0xc0001708a0, {0x0?, 0x0?}, 0xc0002f0150)
        src/core/ssestream/ssemanager.go:113 +0x1b6
created by github.com/JacksonTheMaster/StationeersServerUI/v5/src/web.GetLogOutput.StartConsoleStream.(*SSEManager).CreateStreamHandler.func1 in goroutine 9952
        src/core/ssestream/ssemanager.go:93 +0x409
```

This is due to concurrent closing of the underlaying Http2 Response Writer and Formatting message

Reproducer via artificial delay:
```
    for {
        select {
        case msg := <-client.messages:
            time.Sleep(300 * time.Millisecond)
            _, err := fmt.Fprintf(w, "data: %s\n\n", msg)
            if err != nil {
                logger.SSE.Error(" ❌ Failed to send message: " + err.Error())
                return
            }
            flusher.Flush()

        case <-notify:
            return
        }
    }
```
Fix race condition in SSE handling
…d hardcode in config package for improved maintainability

Co-authored-by: mitoskalandiel <mitoskalandiel@gmail.com>
Comment thread src/core/loader/cmdargs.go Outdated
Co-authored-by: mitoskalandiel <mitoskalandiel@gmail.com>
// Sleep for 30 seconds to follow the standard advertisement timer
time.Sleep(30 * time.Second)
}
}()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akirilov the advertiser should be a singleton and wait on a channel / have some way of stopping it and possibly reloading it. The current implementation will advertise the wrong / default / previous server state (config settings) instead of reloading on config change.

Eg

Suggested change
}()
}(advertiser)

@JacksonTheMaster JacksonTheMaster Oct 10, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also then be added to loader.ReloadBackend()

@mitoskalandiel

Copy link
Copy Markdown
Contributor

closed as per VC with @JacksonTheMaster (due to git-filter-repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants